<template>
  <div class="dialog">
        <div class="background" @click="giveUp()"></div>
        <div class="dialogdiv work">
            <label>兼职审核</label>
            <div class="message">
                <div class="perdiv">
                    <label><strong>兼职名称&nbsp;&nbsp;</strong></label>
                    <input type="text" disabled :value="$store.state.workAdmin.name">
                </div>
                <div class="perdiv">
                    <label><strong>公司名称&nbsp;&nbsp;</strong></label>
                    <input type="text" disabled :value="$store.state.workAdmin.company">
                </div>
                <div class="perdiv">
                    <label><strong>每日薪酬&nbsp;&nbsp;</strong></label>
                    <input type="text" disabled :value="$store.state.workAdmin.salary">
                </div>
                <div class="perdiv">
                </div>
                <div class="text discribe">
                    <div class="textTop">
                        <label><strong>工作详情</strong></label>
                    </div>
                    <div class="textarea">
                        <span>
                            {{$store.state.workAdmin.description}}
                        </span>
                    </div>
                </div>
                <div class="text">
                    <div class="textTop">
                        <label><strong>工作要求</strong></label>
                    </div>
                    <div class="textarea">
                        <span>
                            {{$store.state.workAdmin.condition}}
                        </span>
                    </div>
                </div>
                <div class="perdiv buttons">
                    <button class="yesbtn" @click="examine(1)">通过</button>
                    <button class="deleteUser" @click="examine(2)">不通过</button>
                    <button class="giveup" @click="giveUp()">取消</button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    name: 'WorkDialog',
    methods:{
        giveUp(){
            this.$store.state.dialog = 0
        },
        examine(a){
            axios.post(`http://123.57.251.41:8080/admin-job/auditJob?id=${this.$store.state.workAdmin.id}&code=${a}&classify=${this.$store.state.workAdmin.classify}`,{headers:{'Authentication-Token': JSON.parse(sessionStorage.getItem("token"))}}).then(
                response =>{
                    console.log('该工作通过审核了')
                    console.log(response.data.data.list)
                    this.$store.state.dialog = 0
                },
                error =>{
                    console.log(id)
                    alert("该工作未通过审核",console.log(error))
                    this.$store.state.dialog = 0
                }
            )
        }
    }
}
</script>

<style>

</style>